Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications
Modifying the Main Code Block
The following is a copy of the Main Code Block that executes when you run an HTML-mapping Web object:
The include file
src/web2/hmapmain.icontains the default code that is executed each time a stateless Web object is run and the first time a state-aware Web object is run, as shown:
This code first registers a call to the destroy event procedure as a SpeedScript trigger (
Note: Initialization code is best done in a local initialize rather than changing the Main Code Block directly.ONCLOSEof the Web object).The default destroy procedure removes all traces of the Web object from memory. You can also override the destroy procedure to perform any other cleanup activities that you require before the Web object goes away. This is most useful in state-persistent applications to manage early termination of multi-page database transactions. For more information on database transactions, see Chapter 8, " Controlling Database Transactions."
The initialize event procedure performs a number of data assignments that are necessary before the Web object can execute. You can override this event procedure to add any one-time tasks that you require before
process-web-requestexecutes.If you choose to add code directly to the Main Block before or after any initialization occurs and
process-web-requestexecutes, remember that this code executes only once for state-aware Web objects. Each additional time that the WebSpeed agent or another Web object executes a state-aware Web object using the run-web-object method procedure, only theprocess-web-requestprocedure is executed for the state-aware Web object until it times-out. When it times-out, the destroy event procedure is executed.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |